package com.PrintDemo;

import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JTextArea;


public class MainUI {

	private JFrame frame;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					MainUI window = new MainUI();
					window.frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public MainUI() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frame = new JFrame();
		
		final JTextArea textArea = new JTextArea("gfw_草泥马");
		textArea.setBounds(68, 54, 275, 47);
		frame.getContentPane().add(textArea);
		
		frame.setBounds(100, 100, 450, 300);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.getContentPane().setLayout(null);
		JButton btnNewButton = new JButton("确定");
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				String coments = textArea.getText().trim();
				if(coments!=null&&coments.length()>0){
					System.out.println("确定");
	                GetInfo g = new GetInfo();
	           		String values =g.getInfo(coments);
	           		System.out.println("返回值是： "+values);
				}
			}
		});
		btnNewButton.setBounds(171, 120, 160, 49);
		frame.getContentPane().add(btnNewButton);
	}

}
